package com.orhon.smartcampus.modules.baseinfo.mm;


import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.baseinfo.entity.TimetableItem;
import com.orhon.smartcampus.modules.baseinfo.gqlModel.GQLTimetableItem;

import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper(
        uses = {
                LangMapper.class
        }
)
public interface TimetableItemMapper {

    TimetableItemMapper MAPPER = Mappers.getMapper(TimetableItemMapper.class);
    
    @Mapping(source = "id" , target = "id")
    @Mapping(source = "startTime" , target = "stat_time")
    @Mapping(source = "endTime" , target = "end_time")
    @Mapping(source = "weeks" , target = "weeks")
    @Mapping(source = "name" , target = "name")//lang
    @Mapping(source = "type" , target = "type")
    @Mapping(source = "isClasstime" , target = "is_classtime")
    @Mapping(ignore = true, target = "timetable_id" )
    GQLTimetableItem toTimetableItem(TimetableItem entity);
    
    
    @InheritConfiguration(name = "toTimetableItem")
    List<GQLTimetableItem> toTimetableItemList(List<TimetableItem> entities);



}
